Skip to content

fix: Elastic col width must be at least the length of its name - #13

Merged
tychoish merged 3 commits into
tychoish:mainfrom
bewebi:fix-elastic-col-width
Jul 15, 2026
Merged

fix: Elastic col width must be at least the length of its name#13
tychoish merged 3 commits into
tychoish:mainfrom
bewebi:fix-elastic-col-width

Conversation

@bewebi

@bewebi bewebi commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Fixes a bug whereby BuildMaxWidth() would panic here because the computed width of the elastic column (here) was less than the length of the column's title:

panic: strings: negative Repeat count

This change ensures the width of the elastic column is at least the length of the column's name

@tycho-casap tycho-casap left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test definitely needs to be gofmt'd

@tychoish tychoish left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alter ego

@tychoish
tychoish merged commit 1fd4eb1 into tychoish:main Jul 15, 2026
2 checks passed
tychoish pushed a commit that referenced this pull request Jul 16, 2026
Fixes a bug whereby `BuildMaxWidth()` would panic
[here](https://github.com/tychoish/fun/blob/main/mdwn/table.go#L229)
because the computed width of the elastic column
([here](https://github.com/tychoish/fun/blob/main/mdwn/table.go#L193))
was less than the length of the column's title:
```
panic: strings: negative Repeat count
```

This change ensures the width of the elastic column is at least the
length of the column's name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants